// Regular Cab (Ellinia)
// @author: DejaVu

void npc(Player @player, NPC @npc) {
	int status = npc.getState();
	int city = npc.getSelected();
	int [] maps = {104000000, 102000000, 103000000, 100000000};
	int [] prices = {1200, 1000, 1200, 1000};
	if(player.getJob() == 0 || player.getJob() == 1000 || player.getJob() == 2000){
		prices[0] /= 10; prices[1] /= 10; prices[2] /= 10; prices[3] /= 10;
	}
	if(status == 0){
		npc.addText("What's up? I drive the #p1012000#. If you want to go from town to town safely and fast, then ride our cab! We'll gladly take you to your destination with an affordable price.");
        npc.sendNext();
	}
	else if(status == 1){
		npc.addText("Please choose where you would like to go: \r\n#b#L0##m"+ maps[0] +"#("+ prices[0] +" mesos)#l \r\n#L1##m"+ maps[1] +"#("+ prices[1] +" mesos)#l \r\n#L2##m"+ maps[2] +"#("+ prices[2] +" mesos)#l \r\n#L3##m"+ maps[3] +"#("+ prices[3] +" mesos)#l");
		npc.sendSimple();
	}
	else if(status == 2){
		npc.setVariable("city", city);
		npc.addText("You don't have anything else to do here, huh? Do you really want to go to #b#m" + maps[city] + "##k? it will cost you #b" + prices[city] + " mesos#k.");
        npc.sendYesNo();
	}
	else if(status == 3){
		city = npc.getVariable("city");
		if(player.getMesos() >= prices[city]){
			player.giveMesos(-prices[city]);
			player.changeMap(maps[city]);
			npc.end();
		} else {
			npc.addText("You need #b"+ prices[city] +" mesos#k to go to #m"+ maps[city] +"#.");
			npc.sendOK();
		}
	} else {
		npc.addText("There's a lot to see in this town, too. Come back and find me when you need to go to a different town.");
		npc.sendOK();
		npc.end();
	}
}